import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue';
import SearchView from '../views/SearchView.vue';
import RecommandView from '../views/RecommandView.vue';
import MineView from '../views/MineView.vue';
import AboutView from '../views/AboutView.vue'
import EditView from "../views/EditView.vue";
import SuggestionView from "../views/SuggestionView.vue";
import SettingView from "../views/SettingView.vue"
import ClauseView from "../views/ClauseView.vue"
import MessageView from '../views/MessageView.vue'
// import PublishView from '../views/PublishView.vue'
import DetailView from '../views/DetailView.vue'
import LoginView from "../views/LoginView.vue"
import RegisterView from "../views/RegisterView.vue"
import InspireView from "../views/InspireView.vue"
import ArticleView from "../views/ArticleView.vue"
import SearchResultView from "../views/SearchResultView.vue"
import MissView from "../views/MissView.vue"
import UpdateView from "../views/UpdateView.vue"

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
  },
  {
    path: '/recommand',
    name: 'recommand',
    meta: {
      hideTabBar: false
    },
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: RecommandView
  },
  {
    path: '/about',
    name: 'about',
    component: AboutView
  }, {
    path: '/search',
    name: 'search',
    component: SearchView
  }, {
    path: '/mine',
    name: 'mine',
    component: MineView
  }, {
    path: '/edit',
    name: 'edit',
    component: EditView
  }, {
    path: '/setting',
    name: 'setting',
    component: SettingView
  }, {
    path: '/suggest',
    name: 'suggest',
    component: SuggestionView
  },
  {
    path: '/clause',
    name: 'clause',
    component: ClauseView
  }, {
    path: '/inspire',
    name: 'inspire',
    component: InspireView
  }, {
    path: '/message',
    name: 'message',
    component: MessageView
  }, {
    path: '/detail/goods',
    name: 'detail/goods',
    component: DetailView
  },
  {
    path: '/detail/article',
    name: 'article',
    component: ArticleView
  }, {
    path: '/search/result',
    name: 'searchResult',
    component: SearchResultView
  }, {
    path: '/login',
    name: 'login',
    component: LoginView
  }, {
    path: '/register',
    name: 'register',
    component: RegisterView
  }, {
    path: '/NotFound',
    name: 'NotFound',
    component: MissView
  }, {
    path: '/update',
    name: 'update',
    component: UpdateView
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
